const codeEnum = {
  // 返回数据的状态码
  nodata: 100,
  success: 200,
  fail: 300, // 出错了，给客户端反馈信息，比如缺少必要的参数
  error: 500,
  notfound: 404
}
module.exports = {
  codeEnum,
  successResp: (data, msg) => {
    return {
      code: 200,
      data,
      msg
    }
  },
  failResp: (msg) => {
    return {
      code: codeEnum.fail,
      msg
    }
  }
}
